<template>
	<view class="container">
		<view id="map" class="map">

		</view>

	</view>
</template>

<script module="openGIS" lang="renderjs">
	import GIS from "@/core/ol/ol"
	// import {
	// 	diffDistance
	// } from "@/core/ol/tools/gisMath"
	export default {
		data() {
			return {
				map: null,
				resource: require('@/common/resource.json')
			}
		},
		create() {
			this.initMap()
		},
		mounted() {
			this.initMap()
		},
		methods: {
			initMap() {
				let options = {
					container: 'map',
					baselayer: this.resource.basemap[3],
					center: [108.92, 34.23]
				}

				this.map = new GIS(options)
				this.map.registerEvent('loadend', this.onloadend)
				this.map.registerClickEvent('singleclick', this.onSingleClick)


			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100%;
		height: 100vh;

		.map {
			width: 100%;
			height: 100%;
		}
	}
</style>